﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CommonUtils.Attributes {

  [AttributeUsage(AttributeTargets.Property)]
  public class DBColumn : Attribute {

    public DBColumn() {
    }

    public DBColumn(string columnName, string defaultValue) {
      this._columnName = columnName;
      this._defaultValue = defaultValue;
    }


    public DBColumn(string columnName,bool primariy = false, string defaultValue="") {
      this._columnName = columnName;
      this._defaultValue = defaultValue;
      this._primariy = primariy;
    }

    private string _columnName;

    private bool _primariy = false;

    private string _defaultValue;

    public string ColumnName {
      get {
        return _columnName;
      }

      set {
        _columnName = value;
      }
    }

    public bool Primariy {
      get {
        return _primariy;
      }

      set {
        _primariy = value;
      }
    }

    public string DefaultValue {
      get {
        return _defaultValue;
      }

      set {
        _defaultValue = value;
      }
    }
  }


  [AttributeUsage(AttributeTargets.Class)]
  public class DBTable : Attribute {

    public DBTable() {
    }

    public DBTable(string tableName) {
      this._tableName = tableName;
    }

    private string _tableName;
    

    public string TableName {
      get {
        return _tableName;
      }

      set {
        _tableName = value;
      }
    }
  }


}
